package com.exam.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.exam.mapper.TestJoinMapper;
import com.exam.pojo.entity.TestJoin;
import com.exam.service.TestJoinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TestJoinServicelmpl implements TestJoinService {

   @Autowired
    TestJoinMapper testJoinMapper;

    @Override
    public List<TestJoin> findAll() {
        return testJoinMapper.findAll();
    }

    @Override
    public List<TestJoin> findTestJoin(String examName) {
        return testJoinMapper.findTestJoin(examName);
    }

    @Override
    public List<TestJoin> findAllName() {
        LambdaQueryWrapper<TestJoin> testJoinLambdaQueryWrapper = new LambdaQueryWrapper<>();
        testJoinLambdaQueryWrapper.select(TestJoin::getExamName);
        return testJoinMapper.selectList(testJoinLambdaQueryWrapper);
    }
}
